/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-03-28 08:23:16
 * @LastEditors: voanit
 * @LastEditTime: 2022-03-29 09:36:30
 */
const Mock = require("mockjs");
const data = Mock.mock({
  "list|5": [
    {
      id: "@id",
      title: "@sentence(10, 20)",
      "status|1": ["published", "draft", "deleted"],
      author: "@cname",
      display_time: "@datetime",
      pageviews: "@integer(300, 5000)",
      age: 18,
      imgSrc: "@image('200x100', '#02adea', 'Hello')",
    },
  ],
});

module.exports = [
  {
    url: "/news/getList",
    type: "get",
    response: (config) => {
      const items = data.list;
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items,
        },
        msg: "获取新闻列表数据成功",
      };
    },
  },
];
